import {BasicApi} from "@/common/BasicApi.ts";
import {ParkingLogBo, ParkingLogSearchBo, ParkingLogVo} from "@/dto/Log/ParkingLog.ts";
import Result from "@/common/Result.ts";
import SelectVo from "@/common/SelectVo.ts";
import PageVo from "@/common/PageVo.ts";
import axiosRequest from "@/config/axios.ts";

export class ParkingLogApi implements BasicApi<ParkingLogVo, ParkingLogBo, ParkingLogSearchBo> {
    async deleted(sb: ParkingLogSearchBo): Promise<Result<ParkingLogVo>> {
        return await axiosRequest.post<ParkingLogSearchBo, Result<ParkingLogVo>>("/parking_log/deleted", sb)
    }

    async deletedAll(sbList: Array<ParkingLogSearchBo>): Promise<Result<Array<ParkingLogVo>>> {
        return await axiosRequest.post<Array<ParkingLogSearchBo>>("/parking_log/deleted_all", sbList)
    }

    async edit(b: ParkingLogBo): Promise<Result<ParkingLogVo>> {
        return await axiosRequest.post<ParkingLogBo>("/parking_log/edit", b)
    }

    async editAll(bList: Array<ParkingLogBo>): Promise<Result<Array<ParkingLogVo>>> {
        return await axiosRequest.post<Array<ParkingLogBo>, Result<Array<ParkingLogVo>>>("/parking_log/edit_all", bList)
    }

    async get(sb: ParkingLogSearchBo): Promise<Result<ParkingLogVo>> {
        return await axiosRequest.post<ParkingLogSearchBo, Result<ParkingLogVo>>("/parking_log/get", sb)
    }

    async listAll(sb: ParkingLogSearchBo): Promise<Result<Array<ParkingLogVo>>> {
        return await axiosRequest.post<ParkingLogSearchBo, Result<Array<ParkingLogVo>>>("/parking_log/list_all", sb)
    }

    async option(): Promise<Result<Array<SelectVo<string, number, ParkingLogVo>>>> {
        return await axiosRequest.post<Object, Result<Array<SelectVo<string, number, ParkingLogVo>>>>("/parking_log/option")
    }

    async pageAll(sb: ParkingLogSearchBo): Promise<Result<PageVo<ParkingLogVo>>> {
        return await axiosRequest.post<ParkingLogSearchBo, Result<PageVo<ParkingLogVo>>>("/parking_log/page_all", sb)
    }

    async in(b:ParkingLogBo):Promise<Result<string>>{
        return await axiosRequest.post<ParkingLogBo,Result<string>>("/parking_log/in",b)
    }
    async out(b:ParkingLogBo):Promise<Result<string>>{
        return await axiosRequest.post<ParkingLogBo,Result<string>>("/parking_log/out",b)
    }

}